
import java.util.StringTokenizer;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author igorov
 */
public class PruebaEspacios {

    public static void main(String[] args) {
        String t = "   texto    doblemente tercero   ";

        String[] tokens_string;// = new String[];
        int i = 0;
        StringTokenizer tokens = new StringTokenizer(t);
        tokens_string = new String[tokens.countTokens()];
        while (tokens.hasMoreTokens()) {
            tokens_string[i++] = tokens.nextToken();
        }
        
        for (int j = 0; j < tokens_string.length; j++) {
            String string = tokens_string[j];
            System.out.println("Token: " + string + " lenght: " + string.length());
        }

    }
    
    
}
